package com.atguigu.feign;

import com.atguigu.entity.*;
import com.atguigu.fallback.ProductFallBack;
import com.atguigu.result.RetVal;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@Component
@FeignClient(value = "shop-product",fallback = ProductFallBack.class)
public interface ProductFeignClient {
    //查询SKU基础信息
    @GetMapping("/sku/getSkuInfo/{skuId}")
    public SkuInfo getSkuInfo(@PathVariable Long skuId);
    //查询SKU所在的SPU信息(商品属性)
    @GetMapping("/sku/getSkuSalePropertyKeyAndValue/{productId}/{skuId}")
    public List<ProductSalePropertyKey> getSkuSalePropertyKeyAndValue(@PathVariable Long productId,
                                                                      @PathVariable Long skuId);
    //根据skuId 查询商品的价格
    @GetMapping("/sku/getSkuPrice/{skuId}")
    public BigDecimal getSkuPrice (@PathVariable Long skuId);
    //获取sku的分类信息
    @GetMapping("/sku/getCategoryView/{category3Id}")
    public BaseCategoryView getCategoryView(@PathVariable Long category3Id);
    //通过spuId 获取对应的Json 字符串
    @GetMapping("/sku/getSkuSalePropertyValueId/{productId}")
    public Map getSkuSalePropertyValueId(@PathVariable Long productId);

    //获取首页分类json
    @GetMapping("/product/getIndexCategoryInfo")
    public RetVal getIndexCategoryInfo();

    //根据品牌id查单个品牌信息
    @GetMapping("/product/brand/getBrand/{id}")
    public BaseBrand query(@PathVariable Long id);

    //通过skuID获取平台属性
    @GetMapping("/product/getPlatformPropertyBySkuId/{skuId}")
    public List<PlatformPropertyKey> getPlatformPropertyBySkuId(@PathVariable long skuId);
}
